Save cross-dichroic response to CDP

We import the response values and errors derived in Notebook 4 and save the results in a MIRI MRS CDP format.

In [1]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
The raw code for this IPython notebook is by default hidden for easier reading.
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.''')
Out[1]:
The raw code for this IPython notebook is by default hidden for easier reading. To toggle on/off the raw code, click here.
In [1]:
# import modules
import funcs
import mrsobs

import numpy as np
from astropy.io import fits
import matplotlib.pyplot as plt
plt.style.use('presentation')
%matplotlib notebook

import warnings
warnings.simplefilter('ignore')
In [2]:
# Define paths to data
workDir   = '/Users/ioannisa/Desktop/python/miri_devel/'
cdpDir    = workDir+'cdp_data/CDP7/'
In [10]:
DGAA = 'SHORT'
DGAB = 'MEDIUM'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1A/2BxA)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [9]:
DGAA = 'SHORT'
DGAB = 'LONG'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1A/2CxA)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [12]:
DGAA = 'MEDIUM'
DGAB = 'SHORT'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1B/2AxB)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [14]:
DGAA = 'MEDIUM'
DGAB = 'LONG'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1B/2CxB)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [15]:
DGAA = 'LONG'
DGAB = 'SHORT'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1C/2AxC)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [16]:
DGAA = 'LONG'
DGAB = 'MEDIUM'
filename = 'MIRI_FM_MIRIFUSHORT_12{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (1C/2BxC)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [18]:
DGAA = 'SHORT'
DGAB = 'MEDIUM'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4AxB/3BxA)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [19]:
DGAA = 'SHORT'
DGAB = 'LONG'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4AxC/3CxA)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [20]:
DGAA = 'MEDIUM'
DGAB = 'SHORT'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4BxA/3AxB)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [21]:
DGAA = 'MEDIUM'
DGAB = 'LONG'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4BxC/3CxB)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [22]:
DGAA = 'LONG'
DGAB = 'SHORT'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4CxA/3AxC)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [23]:
DGAA = 'LONG'
DGAB = 'MEDIUM'
filename = 'MIRI_FM_MIRIFULONG_34{}_PHOTOM_7B.03.01.fits'.format(DGAA+'-'+DGAB)
response = fits.open(cdpDir+filename)[1].data

plt.figure(figsize=(9,6))
plt.title('Response {}/{} (4CxB/3BxC)'.format(DGAA,DGAB),fontsize=18)
sc = plt.imshow(response,cmap='jet',vmin=0,vmax=2.5)
cbar = plt.colorbar(sc,pad = 0.03)
cbar.set_label(r'Response [(DN/sec)/(mJy/pix)]', labelpad=30,rotation=270)
plt.xlabel('Detector x-coordinate [pix]')
plt.ylabel('Detector y-coordinate [pix]')
plt.tight_layout()
In [ ]: